import {
  ajax
} from "@/config/apiServer/axios-config.js";
import {
  URLS
} from "@/config/apiServer/urls.js";

// 获取用户列表
export function getUserList(form) {
  return ajax({
    type: 'get',
    typeData: true,
    url: URLS.USER_LIST,
    params: form
  })
}

// 查看用户资产
export function viewUserAssets(uid) {
  return ajax({
    type: 'get',
    typeData: true,
    url: URLS.USER_ASSETS,
    params: {
      uid
    }
  })
}

// 查看用户审核列表
export function userAuditList(param) {
  return ajax({
    type: 'get',
    typeData: true,
    url: URLS.USER_AUDIT_LIST,
    params: param
  })
}

// 用户审核操作
export function userAudit(param) {
  return ajax({
    type: 'post',
    url: URLS.USER_AUDIT,
    params: param
  })
}

//获取用户资产划转信息
export function getInfoTransaction() {
  return ajax({
    type: 'post',
    url: URLS.ASSETS_COMMON,
    params: {
      uri: "/backend/user/backend-manage-info",
      method: "get",
      params: {}
    }
  })
}

//获取用户资产划转信息-手机验证码
export function getTransactionMobileCode(form) {
  let params = {
    area: "86",
    mobile: form.mobile,
    codetype: "quick",
    param: "FzmRandom"
  }
  return ajax({
    type: 'post',
    url: URLS.ASSETS_COMMON,
    params: {
      uri: "/backend/send/sms",
      method: "post",
      params: params
    }
  })
}

//获取用户资产划转信息-邮箱验证码
export function getTransactionEmailCode(form) {
  let params = {
    email: form.email,
    codetype: "quick",
    param: "FzmRandom"
  }
  return ajax({
    type: 'post',
    url: URLS.ASSETS_COMMON,
    params: {
      uri: "/backend/send/email",
      method: "post",
      params: params
    }
  })
}

//用户资产转账
export function transfer(param) {
  return ajax({
    type: 'post',
    url: URLS.ASSETS_COMMON,
    params: {
      uri: "/backend/coin/transfer",
      method: "post",
      params: param
    }
  })
}
